﻿using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Transactions;
using Newtonsoft.Json;
using T.FAS.Runtime.Base.Entity;
using T.ServiceComponent.DAC.Service;
using System.Reflection;
using System.Data;

namespace T.FAS.Runtime.Base.Dao
{
    public class MaskSettingDetailDao : DaoService<MaskSettingDetail>
    {
        public override string TableName => "FAS_MaskSettingDetail";
        public override string IDColumnName => "ID";
        private string ForeignKeyName => "MaskID";
        public override List<string> ExceptColumnName => new List<string> { };

        public MaskSettingDetailDao() : base()
        {
            DBName = "TFAS";
        }
         
        /// <summary>
        /// 从
        /// </summary>
        /// <param name="maskId"></param>
        /// <returns></returns>
        public List<MaskSettingDetail> GetRuleDetailsByForeignKey(string maskId)
        {
            var dt = base.GetByFilter($"{ForeignKeyName}='{maskId}'");
            var result = DaoUtil.ConvertToEntity<MaskSettingDetail>(dt, this.ExceptColumnName);
            return result;
        }

        /// <summary>
        ///  
        /// </summary>
        /// <returns></returns>
        public List<MaskSettingDetail> GetAllRuleDetails()
        {
            var dt = base.GetByFilter($"1=1");
            var result = DaoUtil.ConvertToEntity<MaskSettingDetail>(dt, this.ExceptColumnName);
            return result;
        }
    }
}
